﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp5
{
    //动物共有的吃
    class Animal
    {
        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public Animal(string name)
        {
            this.Name = name;
        }
        public void Eat()
        {
            Console.WriteLine("我是{0}我会吃", this.name);
        }

    }
    //游泳类
    class Swim
    {
        public void swim()
        {
            Console.WriteLine("我会游泳");
        }
    }
    //爬树类
    class Climb
    {
        public void climb()
        {
            Console.WriteLine("我会爬树");
        }
    }
    //猫类
    class Cat : Animal, ICilmb
    {
        public Cat(string name) : base(name)
        {

        }
        public void climb()
        {
            Console.WriteLine("我还会爬树");
        }
    }
    //狗类
    class Dog : Animal, ISwim
    {
        public Dog(string name) : base(name)
        {

        }
        public void swim()
        {
            Console.WriteLine("我还会游泳");
        }
    }
    //鸭类
    class Duck : Animal, ISwim
    {
        public Duck(string name) : base(name)
        {

        }
        public void swim()
        {
            Console.WriteLine("我还会游泳");
        }
    }
    //猴类
    class Monkey : Animal, ICilmb
    {
        public Monkey(string name) : base(name)
        {

        }
        public void climb()
        {
            Console.WriteLine("我还会爬树");
        }
    }
}
